import requests

s = input('请输入要翻译的单词：\n')
query = {
    'kw': s
}
userUrl = 'https://fanyi.baidu.com/sug'
head = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"}

# 页面如果是post请求，主要如果有表单数据，注意请求地址，数据需要在字典中
resp = requests.post(userUrl, data=query)
print(resp.json())




